﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for LimpaComponente
/// </summary>
/// 
namespace Util
{
    public class LimpaComponente
    {
        public LimpaComponente()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public static void limpaTextBox(TextBox txt)
        {
            //txt.Attributes.Add("onfocus", "javascript:" + txt.ClientID + ".value='';");
            txt.Attributes.Add("onfocus", "javascript:this.value='';");
            txt.Attributes.Add("onblur", "javascript:if(this.value == ''){this.value='" + txt.Text + "'};");
        }
    }
}